package gui.view;

import gui.model.model;

import java.awt.Dimension;
import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class registerFrame extends JFrame{

	private JLabel lblUsername;
	private JLabel lblPassword;
	private JTextField txtUsername;
	private JTextField txtPassword;
	private JButton btnRegister;
	
	private JPanel topPanel;
	
	public registerFrame(model m)
	{
		topPanel = new JPanel();
    	topPanel.setPreferredSize(new Dimension(200,200));
    	topPanel.setLayout(new FlowLayout());
    	this.getContentPane().add(topPanel);
    	
    	lblUsername = new JLabel("Username:");
    	lblPassword = new JLabel("Password:"); //create panels and components
    	txtUsername = new JTextField();
    	txtUsername.setPreferredSize(new Dimension(80,20));
    	txtPassword = new JTextField();
    	txtPassword.setPreferredSize(new Dimension(80,20));
    	btnRegister = new JButton("Register");
    	btnRegister.setText("Register");
    	
    	topPanel.add(lblUsername); //add components to panel
    	topPanel.add(txtUsername);
    	topPanel.add(lblPassword);
    	topPanel.add(txtPassword);
    
    	topPanel.add(btnRegister);
    	this.setTitle("Register");
    	this.setResizable(false);
    	this.setSize(200,200);
    	this.setLocationRelativeTo(null); //set frame to middle of screen
	}
	
}